#pragma once
#include <map>
#include <time.h>
#include <stdlib.h>
//#define uint unsigned int
#define MAXCACHESIZE 20480

typedef unsigned int uint;

class Cache {
	public:
		std::map <uint, char *> cacheBlocks; // map of the cache blocks: fully associative
		std::multimap <time_t, uint> LRUinfo; // map of the last time the file was modified, for LRU policy
		Cache();
		
		//This method checks to see if the block is in the cache, inserts it if it is not
		//If the cache is full, it uses the LRU policy to select a block to remove from the cache
		void InsertBlock(uint blockAddr, char *); 
		
		//This method searches the cache for a specific block by its address
		char *FindBlock(uint blockAddr);
		
		//update the modification time for a block in the LRU map
		void TouchBlock(uint blockAddr);  
		
		//cleanup the cache!		
		void CleanUp(); 
};
